
import axios from "axios";
import evn from "./env";
const instans = axios.create({
  baseURL: evn.load.baseURL,
  timeout: 5000,
});
// 请求拦截
instans.interceptors.request.use(
  (config) => {
    console.log("请求成功", config);
    return config;
  },
  (error) => {
    console.log("请求失败", error);
    return Promise.reject(error);
  }
);
// 响应拦截
instans.interceptors.response.use(
  (res) => {
    console.log("响应成功", res);
    return res.data;
  },
  (error) => {
    console.log("响应失败", error);
    return Promise.reject(error);
  }
);
export default instans;
